home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpwin31.zip / SHELLAPI.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-06  |  3KB  |  92 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Turbo Pascal for Windows Run-time Library       }
  5. {       Windows 3.1 API Interface Unit                  }
  6. {                                                       }
  7. {       Copyright (c) 1991 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit ShellAPI;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. const
  18.   Error_Success = 0;
  19.   Error_BadDB = 1;
  20.   Error_BadKey = 2;
  21.   Error_CantOpen = 3;
  22.   Error_CantRead = 4;
  23.   Error_CantWrite = 5;
  24.   Error_OutOfMemory = 6;
  25.   Error_Invalid_Parameter = 7;
  26.   Error_Access_Denied = 8;
  27.  
  28.   reg_SZ = 1;                           { string type }
  29.  
  30.   hKey_Classes_Root = 1;
  31.  
  32. { necessary types.  Everything in this API is 32-bit. }
  33.  
  34. type
  35.   HKey = Longint;
  36.   PHKey = ^HKey;
  37.  
  38. { API exports from the library }
  39.  
  40. function RegOpenKey(Key: HKey; SubKey: PChar; var Result: HKey): Longint;
  41. function RegCreateKey(Key: HKey; SubKey: PChar;var Result: HKey): Longint;
  42. function RegCloseKey(Key: HKey): Longint;
  43. function RegDeleteKey(Key: HKey; SubKey: PChar): Longint;
  44. function RegSetValue(Key: HKey; SubKey: PChar; ValType: Longint;
  45.   Value: PChar; cb: Longint): Longint;
  46. function RegQueryValue(Key: HKey; SubKey: PChar; Value: PChar;
  47.   var cb: Longint): Longint;
  48. function RegEnumKey(Key: HKey; index: Longint; Buffer: PChar;
  49.   cb: Longint): Longint;
  50.  
  51. function DragQueryFile(Drop: THandle; FileIndex: Word; FileName: PChar;
  52.   cb: Word): Word;
  53. function DragQueryPoint(Drop: THandle; var Pt: TPoint): Bool;
  54. procedure DragFinish(Drop: THandle);
  55. procedure DragAcceptFiles(Wnd: HWnd; Accept: Bool);
  56.  
  57. function ExtractIcon(Inst: THandle; ExeFileName: PChar; IconIndex: Word): HIcon;
  58.  
  59. { error values for ShellExecute() beyond the regular WinExec() codes }
  60. const
  61.   se_err_Share = 26;
  62.   se_err_AssocIncomplete = 27;
  63.   se_err_DDETimeout = 28;
  64.   se_err_DDEFail = 29;
  65.   se_err_DDEBusy = 30;
  66.   se_err_NoAssoc = 31;
  67.  
  68. function ShellExecute(hWnd: HWnd; Operation, FileName, Parameters,
  69.   Directory: PChar; ShowCmd: Integer): THandle;
  70. function FindExecutable(FileName, Directory, Result: PChar): THandle;
  71.  
  72. implementation
  73.  
  74. function RegOpenKey;                       external 'SHELL'    index 1;
  75. function RegCreateKey;                     external 'SHELL'    index 2;
  76. function RegCloseKey;                      external 'SHELL'    index 3;
  77. function RegDeleteKey;                     external 'SHELL'    index 4;
  78. function RegSetValue;                      external 'SHELL'    index 5;
  79. function RegQueryValue;                    external 'SHELL'    index 6;
  80. function RegEnumKey;                       external 'SHELL'    index 7;
  81. function DragQueryFile;                    external 'SHELL'    index 11;
  82. function DragQueryPoint;                   external 'SHELL'    index 13;
  83. procedure DragFinish;                      external 'SHELL'    index 12;
  84. procedure DragAcceptFiles;                 external 'SHELL'    index 9;
  85. function ExtractIcon;                      external 'SHELL'    index 34;
  86. function ShellExecute;                     external 'SHELL'    index 20;
  87. function FindExecutable;                   external 'SHELL'    index 21;
  88.  
  89. end.
  90.  
  91.  
  92.